soooooo much refactor