fix memory corruption
split tests
use irbuilder