test updates and code cleanup