refact version 2