simplified

removed 'window' dependency