refact for beta