minor hygiene and refactoring