refactored allocation and loading of sections