mostly done with refactoring
.