Improve dashboard and extract common code