refactor + fixes
refactor + fixes