use same approach for 5.6 and 5.7