major revamp of structure, refactored into modules