update / clean up code