Update for cleaner implementation.