handle null in values collection in factory
use small classes to improve db communication