Adding documentation... minor refactors.