Refactor code : move menu into a file