Some tweaks for simplicity and better cross browser compatibility