refactoring of code, fixes for hiding classes