Housekeeping operations. (Remove redundant code, unused imports, dead branches)