fixes and refactoring
commit