Working on finishing some refactoring