Changed private methods to public due to php 5.3's restrictions