refractor the code to include tools library for usage by all functions.

this change helps with code repetition  and with ease of code.
should update the tools to preform Overloading for a few use cases

[fixed #24]