Reduce complexity in loadFromPath method