generating items and setting markers
little bit of refactor