move thumb code to if branch