Cleaned up a lot of code, improved polling, etc...