Refactored obtaining folders out to their own method.