Refactored test with before