Allow setting a custom hint container and refactor the shortcut function