refactor out app class