inline some functions, combine bool functions