code refactoring

removed the window parameter
some improvements on the equality operator