Remove unused method
Fix several legacy code issues