Can we use something like this? http://programmers.stackexchange.com/a/182074