Large overhaul of code to move to aws