add inner filter, update to more strict mode

jshint happy
some stylistic corrections