Renamed js function for clarity