Clean up input and log clearing code.