refactor to make things less cluttered