Cleaned up Initialize() function.