Dependencies improvement and added some tests