Small refactors and clean ups