Refactored, now public interface and logic is seperate.