Common utility functions