refactoring and small improvements