Refactoring - still doesnt work