core function implement