Some code clean-ups