cleant up code