Some refatoring