refactoring coffeescript for meter widget