use require js to clean up the mess