performance optimezation done a bit of cleanup is nedded