Working wersion wothout refactoring