refactored by using the mixin functionality of jade.