Fix "/pet" permissions
Fix "/pet reload"
Code refactoring and cleanup.