moved the logic into another file