turned function to static inline