Remove unneeded part from function, fix indentation