Common frontend code.