refactor to use startsWith