separate logic into different modules