Cleaned up code and docs