better way for this