refactor, add helper functions
set to headless