refactory classMethods with callback pattern