Refactored the main interface to make it cleaner. Added more docs