Pulls out common logic from decorator and mixin, and adds check for configuration