refactor recalculate height