Refactored items.
Added tests.