buckle check refactoring