several updates and refactors.