fixes indentation and remove unused code