improve source code for easy reading

improve source code for easy reading.
change post link from front view to edit.
move get and list data to model.