Refactorings - extracted a few methods for reuse.