refactor
fix #10, improved capability checking