Refactor pasteEntry function to be more os agnostic