Refactored, but still doesnt work.