use boost::optional to remove code duplication
make Keys enum class