refactor: remove superfluous condition check in setValue