Added test for data. Code cleanup