move code to suitable place