Remove redundant code.
Remove functions only tested, not used.
Remove unused functions.