initialize classes before reading from datasource