start of ninja
refactor