Refactor with studying Python