refactor some code ( again )