split logic into system and application