Removing code from a wrong place