refactoring app and message files