api improvements

This pullRequests adds toBuilder method to structures