move implementation to separate file