Fix bug where function was incorrectly referenced without "this"

Function was incorrectly called as if registered on factory object,
which is now directly returned.