Cleanup unused code. Start to add tests for the admin permissions.