fixes. refactoring