Code refactoring finished and tested - everything works!