Refactoring of task 05 by SanSanych