Optimize and remove call of loadFromArray