some last changes to clean up code