Enabled button injection for endless loading.

Also refactored a bit.