Added specific code for each binding type

fixed #14, fixed #17