Some refactoring. Added support for option parameters (like target=foo.out)