refactored subnet class for binary functions