apply Promise
move database logics to models Classes