Code refactored
Decorators added for exception handling and checking privileges