rewrite code :P