Refactored into modules
Improved documentation