Refactored helper methods to extend.js