Implementation of the Prepare functionality