refactoring and little optimisation