refactoring and added first task test