Some refactoring in intellij idea