Added pagination and performance tweaks.