refactor calling Nailgun

Change-Id: Icb0c7028967c748008dd32cb8b66eb627fd7bded