clean up user-data script to be more compact
add more comments to user-data script