prepare and finish are optional