moved code to expected places