extracted some meaningful methods to simplify understanding