Often I start out with something someone else has made, if it exists. When I realize this is a crucial part, then I can start developing my own version. Usually first a wrapper, which later can be extended to it's own. The rest of the code won't know when it's a wrapper or component, that's the trick here.