Moved helper method from "this" to closure scope as Jasmine has a different "this" context.
Moved helper method from "this" to closure scope as Jasmine has a different "this" context.