Refactor to one function
Refactor options, now all objects use the a common options
Update test files to new api