extracted a few methods