Freed allocated memory and renamed a method