replacing boolean by methods