Refactoring of internal classes