Refactoring encasapi as module