Remove duplicate function and fix newline