Refactoring picloader and picmetadata.