Moved logic to JS, separator replaces