code cleanup + testing issues overcome