more rc.lua refactoring