Improve lazy loading and add documentation