Cleanup

modularization plus subcoming to the wisdom of @mourner when it comes to callbacks (promises are still on the table, just kidding, or am I?)