Added phpDoc comments, refactored method signatures in some cases