Remove unused code and fix indentation