Refactored, added a separate function for normalising the separator