Refactored js to use Mixins.