Improve struct handling