[CLEANUP] - Refactored and added Unit tests