Encapsualting the draft functionality into a function