Code refactoring and access levels fix