Add support for customize cap

Fixes #18