Documentation + cleaner code