some refactoring ideas.