Divided application logic out into separate file