Revert "Restructuring logic and removing duplicated code"

Reverts nmadhok/OpenInTerminal#10