small cleanup + refactor