refactored bed_tests