Encapsulate code in many different functions