Refactorized the classes that created the profiles to make the code processing code inside a Controller