Rename functions for simples names and remove unnecessary code