split logic into modules