Refatoring tests and src files