cleaner handling of last commit