improve handling different data structures..