Cleaning up code for ASD