Moved helper method from "this" to closure scope as Jasmine has a different "this" context.
Removed FIXME, reduced debug logging