refactor code after IDEA analiz