Refactor: Simplified code for adding blocks to a page