separate application logic