refactored with before each blocks
removed before blocks