refactoring, optimising