make centering common fn