Add configurable options and optimize