extracted some methods