refactord inventory script into multiple files in its own subdir