Made stateless methods static & minor refactorings.