Cache jquery variables and make some little tweaks