added findByType and some other features