Replaced repetitive code with mixins.