update; cleaner code