Improve bind and added tests