added reusable functions