restructuring, satisfying jshint :)