Parameterize some variable types and remove some unused imports.