refactored files into app directory