refactoring document ui + unit snap