I don't think you need to have separate logic for handling an empty prefix.