Refactor programm