Integrate some library functions

I think we should remove it, like you said it's not time critical and it probably executes pretty fast right now.