code refactor + todos