Adding support for build tools. Cleaning up code