Refactoring

working towards getting things functional