separated code into parts