renamed some methods, allow to run as object or command line script