Add better support for custom structs