Abstract away case statement in generic-access.js