cleaned up more code