Cleanup, rename and modularize