clean code + improvements