move app logic out of object