More refactoring

Thanks to Solomon Hawk! http://codepen.io/shawkdsn/