Removed unused code. Improve API documentation