cleans up
moves inherits function into utils.js
major refactoring - reduces magic numbers