optimized code according to jshint, deleted unused files