Some cleaning up, removed old code