Refactor and clean code based on Idea IDEA analysis