Some options and db refactoring
Removed unnecessary vars