code cleanup
removing unnecessary mem allocation