Moved to separate function