Cleaned up code, no functionality changes