encapsulate one function