rearranged methods so they're easier to follow