refractoring contracts page; not working