move code to src file