Some code refractoring and server upload limits