Refactored the way buildUi conditional us used