becoming a mess, need to refactor