Some changes and refactors.