- some refactoring thanks to intelliJ ultimate ;)