reducing memory consumption. work in progres ...