Cleaner program, also thread-Safe