tidying, refactoring