Minor changes and refactors