change hash syntax to 1.9 & refactored where calls