Make more generic, easier to use from command line