Encapsulate functionalities into functions