fixed build references
set up code for simple optimiziations