Cleaned up excerpt function