Neater list replacement.
Added support for categories.