Move angCheck function to a helper file