Fixed extends and mixin. Removed duplicate code.