Clean up
Extract magic numbers