Added proper interfaces + small refactor