Refactored and added warmup.