CRAFTER-1983: Reorganize the code to create a function to render the edit button and call it in render function