extracting out code