split up ability test and refactor to elegant reusable code