remove unecessary code from for generating response