[WIP] code clean up. some more method documentation