Maybe do same as above suggestion - move var statements inside if to avoid unnecessarily calling them if $el.val() === ''?