Refactored to match with shiroyuki/melodic-js