Remove duplicated code

center is duplicated