SOme code refactoring, i don't know what i want