Remove unused and not completely correct code