Refactoring classes to be as a class and methods and resolving some inheritances