thread proc through some functions