restructure profile module code to conform to Angular best practices