Further tweaking, preparing for unittest insertion