code clean; remove circular dependencies; jshint compliant