mo' refactoring and documenting