Reverted previous commit and optimized logic to get h/w from query params