refactor, tidy, comments