Common utilities and base classes