Refactor code using Idea inspection tool