[cleanup] Formatted code
[misc] Changed the rights checking mechanism to remove an inter-module dependency