improved invoke tests to prepare for unit tests