updated documentation and rewrote some interfaces for better encapsulation