Extracts common functionality