separated code, deleted unused code