Initial updates and cleaning up code