Seperated out the code