rework cabinet and add tests