Refactored methods around to make documentation easier.