refactoring/fixes