refactored a bit
more refactoring. Trying to figure out how to do updates...