refactors some naming, and adds docs