refactor everything to work with tools as well