elastic (refactored)