Refactored rounded corner generation.