Refactor to simplify
code upload