Some generic code for blur sub-library