code cleanup and removed test