Character deletion support and code cleanup