separate logic into different files