Fill missing type signatures, remove unused code