Extra spacing and speed improvements

I've added some extra lines for readability.
I've used the application instance where appropriate for speed reasons.
I've fixed the paginator.

These changes are untested, so after this is merged, we can test it. I see no reason why this shouldn't work though.