better logic w/ handling encode args