Simpler code
FIX ##34. Support file uploads
Move code where it belongs