Remove old code and improve comments