refactored database access.
v5.7
implement move up and down.
v5.8