Commonly used functions and templates