Cleaned up unneeded optionals and type conversations.