reworked the system to work as a npm module :D