more code refactoring/tweaking; set sensible defaults; condition advanced features using toggle option