jet brains annotations, bug fixes, refactoring