some code cleanups, remove useless parts