As with functions, modules, libraries and packages, wrap up common operations into reusable code. This might be a module for installing and configuring java, or deploying a particular application type.
Ansible has modules and chef and puppet have providers for creating new operations.
They really hate to be the ones saying them.