[PATCH v3 2/3] cabinet: fix style, move to separate file