added DataSink and DataSource and moved some stuff around