Finished refactoring code

Kyle...