approach switching in a more modular way, introducing first/last in addition to prev/next