Cleaned up Tornado code