cleaned up code for Data class