first try on the refactor