code cleanup + logging everything in milliseconds