bit of refactoring and put back into intellij project structure