refactored decorators and added logging