upload working minimal & improve code