move more logic to react expression