initial implementation of keyvalue stuff