Refactored, added options.