add promises, reorganize