Do some minor refacts.