Move returns/redirects to inside serialize block