Refactor input source creation.