optimized a bit to make it more OO :)