Improve test executable logic