modularized access.js a little