Refactored. Changed packaging