some refactoring, documenting, and author tagging