Start moving logic into separate file