remove some duplication and improve names