re-arranging method, consider moving to a helper class