improved bagel implementation and added it as a configuration option