Eliminate duplicate calculateValue/setValue. And layout after value change