Cleaning up code for view pagers