fixes & refactorings