Completely refactored this. REOL-65
Override js differently. REOL-65