remove dead code
partially fixes #768, #794, #812