'Borrowing' some thoughtbot code