code cleanup
simplified code, use opendata interface
code format