Reworked get_actions
Use a generator expression for pages, added explanatory comments