refactored to work with boost 1.55