Miscellanious code pieces