Cleaning code: reorganize code and change methods' name