Remove useless references, cleanup