update various parts, add some tests