sorting of methods
allowing targetName to be null and empty