refactored prepare() method