added init file and refactored app into a class