RD|PM: refactor - complete. dont put beautified js live