replaced most static_asserts with std::enable_if