added constructor and cache in units