code cleanup + better reports