some clean up and refactor to get better performance at client side, also trying to use spin.js to show a loading step...