Refactor: eliminating unnecessary querySelector