Code cleanup, remove dead code