Modified the kv class to fit unit-test