still cleaning up permissions code