Extacted more logic to common mixin