Hi, I'd like to use this as a library. Would you be open to restructuing the code a little to support this? Thanks!