Some more wrapping and refactoring
Same functionality, less code!